package com.copm.ifm.base.basic.pojo;

import com.copm.ifm.base.basic.constant.DbConstants;
import com.copm.ifm.base.basic.util.AuthUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 数据字典内容业务对象
 *
 * @author zzf
 * @date 2020/12/23 10:27
 */
@Getter
@Setter
@ToString
@ApiModel("系统字典内容实体类")
public class DictContentBO implements Serializable {

    @ApiModelProperty("值，单个字典内容中不允许重复")
    private String value;

    @ApiModelProperty("值-繁体")
    private String ftValue;

    @ApiModelProperty("值-英语")
    private String enValue;

    public String currentUserLanguageName() {
        switch (AuthUtils.getCurrentUserLanguage()) {
            case DbConstants.LANGUAGE_CN:
                return this.value;
            case DbConstants.LANGUAGE_FT:
                return this.ftValue;
            default:
                return this.enValue;
        }
    }
}
